$OpenBSD: patch-libide_util_ide-posix_c,v 1.2 2017/04/17 14:45:58 ajacoutot Exp $
--- libide/util/ide-posix.c.orig	Fri Mar 24 00:38:30 2017
+++ libide/util/ide-posix.c	Mon Apr 17 15:08:31 2017
@@ -21,7 +21,11 @@
 #include <sys/user.h>
 #include <sys/utsname.h>
 #include <unistd.h>
+#if !defined(__OpenBSD__)
 #include <wordexp.h>
+#else
+#include <glob.h>
+#endif
 
 #include "ide-posix.h"
 
@@ -92,6 +96,7 @@ ide_get_system_page_size (void)
  * Returns: (transfer full): A newly allocated string containing the
  *   expansion. A copy of the input string upon failure to expand.
  */
+#if !defined(__OpenBSD__)
 gchar *
 ide_path_expand (const gchar *path)
 {
@@ -116,6 +121,33 @@ ide_path_expand (const gchar *path)
 
   return ret;
 }
+#else
+gchar *
+ide_path_expand (const gchar *path)
+{
+  glob_t state;
+  gchar *ret = NULL;
+  int r;
+
+  if (path == NULL)
+    return NULL;
+
+  r = glob (path, GLOB_ERR, NULL, &state);
+  if(r == 0 && state.gl_pathc == 1 && state.gl_pathv) {
+    ret = g_strdup (state.gl_pathv[0]);
+  }
+  globfree(&state);
+
+  if (!g_path_is_absolute (ret))
+    {
+      g_autofree gchar *freeme = ret;
+
+      ret = g_build_filename (g_get_home_dir (), freeme, NULL);
+    }
+
+  return ret;
+}
+#endif
 
 /**
  * ide_path_collapse:
